package org.SPI;

import java.io.IOException;
import java.util.Iterator;

/**
 * Hello world!
 *
 */
public class App {
    public static void main( String[] args ) throws ClassNotFoundException, IOException, InstantiationException, IllegalAccessException {
    	SimpleServiceLoader<IHelloService> matcher = SimpleServiceLoader.load(IHelloService.class);
        Iterator<IHelloService> matcherIter = matcher.iterator();
        while (matcherIter.hasNext()) {
        	IHelloService hs=matcherIter.next();
        	hs.sayHello("james");
        }
    }
}
